
export default {
    getTimeZone,
    isJson,
    clone,
    showAPIUrl
}
function getTimeZone() {
    const offsetMinutes = new Date().getTimezoneOffset();
    const offsetHours = Math.abs(offsetMinutes / 60);
    const offsetSign = offsetMinutes > 0 ? '-' : '+';
    const timeZone = `UTC${offsetSign}${offsetHours}`;
    return timeZone;
}
function isJson(str) {
    let isValid = true;
    if (typeof str == "string") {
        try {
            let obj = JSON.parse(str);
            if (typeof obj == "object" && obj) {
            } else {
                isValid = false;
            }
        } catch (e) {
            console.log("error：" + str + "!!!" + e);
            isValid = false;
        }
    }
    return isValid;
};
function clone(o) {
    return JSON.parse(JSON.stringify(o));
}
function showAPIUrl() {
    setTimeout(function () {
        try {
            var ele = document.querySelectorAll('[data-api-url]');
            if (!ele || ele.length == 0) return;
            ele.forEach(function (element) {
                element.ondblclick = function () {
                    let api = this.dataset.apiUrl;
                }
            });
        } catch (e) {
            console.log(e);
        }
    }, 1000);
}